#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <mutex>

class Config
{
public:
	static Config* GetInstance()
	{
		if (_sInfo == nullptr)
		{
			std::lock_guard<std::mutex> lock(_mtx);
			if (_sInfo == nullptr)
			{
				_sInfo = new Config;
			}
		}
		return _sInfo;
	}
	std::string GetIp()
	{
		return _ip;
	}
private:
	Config(){}
	Config(const Config& config) = delete;
	Config& operator=(const Config& config) = delete;

	std::string _ip = "172.0.0.1";
	int _port = 80;

	static Config* _sInfo;
	static std::mutex _mtx;
};

Config* Config::_sInfo = nullptr;
std::mutex Config::_mtx;